<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class MY_Controller extends CI_Controller {

    // constructor of this controller
    public function __construct() {
        parent::__construct();

        $this->load->library('session');
        //$this->load->model('admin/Video_model');	
    }

    public function show_view($view, $data = '') {
        $s = $this->session->all_userdata();

        $tmp = $s['0'];
        $id = $tmp->id;
        // $username = $tmp->username;
       // $image = $tmp->image;
        //  $name = $tmp->name;
        //    $date = $tmp->create_time;
        // print_r($image);
        if ($id != '') {
            $data1 = $this->session->all_userdata();
            $this->session->set_userdata('userName', $tmp->username);
            $this->session->set_userdata('Name', $tmp->name);
            $this->session->set_userdata('Date', $tmp->create_time);
          
            $this->session->set_userdata('Image', $tmp->image);
            $this->load->view('header');
            $this->load->view('sidebar');
            $this->load->view($view, $data);
            $this->load->view('footer');
        } else {
            redirect(base_url());
        }
    }

}
